package com.yiwyn.demo.controller;

import com.yiwyn.demo.service.TaskService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class TaskController {


    private final TaskService taskService;

    public TaskController(TaskService taskService) {
        this.taskService = taskService;
    }

    @GetMapping("/runTask")
    public String runTask(Integer apiCode) {
        log.info("apiCode:{}", apiCode);

        taskService.runTask(apiCode);

        return "hello Yiwyn";
    }

}
